package main.singleton;

/**
 * 饿汉式单例：
 * @author: kejl
 * @create: 2020-07-13 23:14
 */
public class EagerSingleton {

    //我是饿汉，我早早的在系统初始化的时候都创建了这个，也不会有再次访问不一致的问题
    private static EagerSingleton  eagerSingleton  = new EagerSingleton();

    private EagerSingleton(){

    }

    public EagerSingleton getInstance(){
        return  eagerSingleton;
    }


}
